package com.jfinal.demo.core.service;

import java.util.List;

import com.jfinal.demo.core.entity.Member;

/**
 * 会员service。
 * 
 * @author Administrator
 * 
 */
public class MemberService {

	public static final MemberService memberService = new MemberService();

	public boolean saveOrUpdateMember(Member member) {
		return Member.dao.saveMember(member);
	}

	public Member findMemberById(Integer id) {
		Member member = Member.dao.findById(id);
		return member;
	}

	public List<Member> findAllMembers() {
		List<Member> list = Member.dao.find("select * from member");
		return list;
	}

	public boolean deleteMemberById(Integer id) {
		if (id != null) {
			return Member.dao.deleteById(id);
		}
		return false;
	}
}
